using System;
using System.Reflection;
using SwinGame;
using Color = System.Drawing.Color;

namespace RandomShapeGenerator.src
{
    public class GameMain
    {
        public static void Main()
        {
            //Set the path to the application so the resource manager can
            //find the files it needs to load.
            Resources.SetAppPath(Assembly.GetExecutingAssembly().Location, true);

            //Start the audio system.
            Audio.OpenAudio();

            Core.OpenGraphicsWindow("GameMain", 800, 600);
            
            DrawingController dc = new DrawingController();


            
            //Run the game loop

            while (!Core.WindowCloseRequested())
            {
                //Fetch the next back of UI interaction
                Core.ProcessEvents();
                Graphics.ClearScreen();
                dc.RefreshPallette();
                dc.HandleInput();
                dc.Draw();
                

                //Draw onto the screen
                Core.RefreshScreen();
            }

            //End the audio
            Audio.CloseAudio();
            Resources.ReleaseAllResources();
        }
    }
}
